/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.app.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.thinkgem.jeesite.common.persistence.DataEntity;
import com.thinkgem.jeesite.modules.cms.entity.Category;
import com.thinkgem.jeesite.modules.cms.entity.CmsBusiness;
import com.thinkgem.jeesite.modules.sys.entity.Office;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 商家信息录入展示Entity
 * @author 张朋
 * @version 2016-06-16
 */
public class ACmsBusiness extends DataEntity<ACmsBusiness> {
	
	private static final long serialVersionUID = 1L;
	private String officeId;		// 小区编号
	private String categoryId;		// 分类编号
    private String officeName;
    private String categoryName;
	private String name;		// 名称
	private String description;		// 描述
	private String image;		// 图片
	private String images;		// 图集
	private String price;		// 价格
	private String introduce;		// 介绍描述
	private String address;		// 地址
	private String phone;		// 电话
	private String mobile;		// 手机
	private String weight;		// 权重,越大越靠前
	private String hits;		// 点击量
	private Date weightDate;		// 权重期限
	private String posid;		// 推荐位

	
	public ACmsBusiness() {
		super();
	}

	public ACmsBusiness(String id){
		super(id);
	}

    public ACmsBusiness(CmsBusiness cmsBusiness){
        super();
        this.id = cmsBusiness.getId();
//        this.categoryName = cmsBusiness.getCategory().getName();
//        this.officeName = cmsBusiness.getOffice().getName();
//        this.categoryId = cmsBusiness.getCategory().getId();
//        this.officeId = cmsBusiness.getOffice().getId();
        this.name = cmsBusiness.getName();
        this.description = cmsBusiness.getDescription();
        this.image = cmsBusiness.getImage();
        this.images = cmsBusiness.getImages();
        this.price = cmsBusiness.getPrice();
        this.introduce = cmsBusiness.getIntroduce();
        this.address = cmsBusiness.getAddress();
        this.phone = cmsBusiness.getPhone();
        this.mobile = cmsBusiness.getMobile();
        this.remarks = cmsBusiness.getRemarks();
    }

    public String getOfficeId(){ return officeId; }

    public void setOfficeId( String officeId){ this.officeId = officeId; }

    public String getCategoryId(){ return categoryId; }

    public void setCategoryId( String categoryId){ this.categoryId = categoryId; }

    public String getOfficeName(){ return officeName; }

    public void setOfficeName( String officeName ){ this.officeName = officeName; }

    public String getCategoryName(){ return categoryName; }

    public void setCategoryName( String categoryName ){ this.categoryName = categoryName; }
	
	@Length(min=1, max=255, message="名称长度必须介于 1 和 255 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=0, max=255, message="描述长度必须介于 0 和 255 之间")
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
	@Length(min=0, max=255, message="图片长度必须介于 0 和 255 之间")
	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}
	
	@Length(min=0, max=6500, message="图集长度必须介于 0 和 6500 之间")
	public String getImages() {
		return images;
	}

	public void setImages(String images) {
		this.images = images;
	}
	
	@Length(min=0, max=64, message="价格长度必须介于 0 和 64 之间")
	public String getPrice() {
		return price;
	}

	public void setPrice(String price) {
		this.price = price;
	}
	
	@Length(min=0, max=9999, message="介绍描述长度必须介于 0 和 9999 之间")
	public String getIntroduce() {
		return introduce;
	}

	public void setIntroduce(String introduce) {
		this.introduce = introduce;
	}
	
	@Length(min=0, max=255, message="地址长度必须介于 0 和 255 之间")
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	
	@Length(min=0, max=255, message="电话长度必须介于 0 和 255 之间")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	@Length(min=0, max=255, message="手机长度必须介于 0 和 255 之间")
	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	
	@Length(min=0, max=11, message="权重,越大越靠前长度必须介于 0 和 11 之间")
	public String getWeight() {
		return weight;
	}

	public void setWeight(String weight) {
		this.weight = weight;
	}
	
	@Length(min=0, max=11, message="点击量长度必须介于 0 和 11 之间")
	public String getHits() {
		return hits;
	}

	public void setHits(String hits) {
		this.hits = hits;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getWeightDate() {
		return weightDate;
	}

	public void setWeightDate(Date weightDate) {
		this.weightDate = weightDate;
	}
	
	@Length(min=0, max=10, message="推荐位长度必须介于 0 和 10 之间")
	public String getPosid() {
		return posid;
	}

	public void setPosid(String posid) {
		this.posid = posid;
	}

		
}